package com.settlement.system.controller;

import com.settlement.system.common.enums.ReturnStatusEnum;
import com.settlement.system.common.exception.ServiceException;
import com.settlement.system.model.entity.common.TblAkcDifferentReport;
import com.settlement.system.reply.ObjectDataResponse;
import com.settlement.system.service.IBaseService;
import com.settlement.system.service.ITblAkcDifferentReportService;
import com.settlement.system.common.util.common.FasUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;
import java.util.Map;

/**
 * 爱库存-差异报表 前端控制器
 * @author Ximi
 * @since 2020-06-30
 */

@Api(tags = "爱库存-差异报表",description = "爱库存-差异报表")
@RestController
@RequestMapping("/akc/different_report")
public class TblAkcDifferentReportController extends MergeApiExcelController<TblAkcDifferentReport, Map<String,Object>> {

    @Resource
    private ITblAkcDifferentReportService tblAkcDifferentReportService;

    @Override
    public IBaseService init() {
        return tblAkcDifferentReportService;
    }

    @Override
    public Class<?> getModelClass() {
        return TblAkcDifferentReport.class;
    }

    @Override
    protected void setParamsModel(Map<String, Object> model) {
        FasUtil.formatInQueryCondition(model,"shopNo");
        super.setParamsModel(model);
    }

    @Override
    protected void setFootModel(Map<String, Object> result, Map<String, Object> model) throws ServiceException {
        result.put("foot",tblAkcDifferentReportService.getFoot(model));
    }


    /**
     * 保持
     *
     * @return
     */
    @Deprecated
    @ApiOperation(value = "删除全部数据")
    @RequestMapping(value = "/api/deleteAll", method = RequestMethod.POST)
    public ObjectDataResponse<Integer> deleteAll() {
            return new ObjectDataResponse(0,ReturnStatusEnum.REQUEST_SUCCESS.getValue(),
                    ReturnStatusEnum.REQUEST_SUCCESS.getText());
    }
}

